<?php
require_once '..\smarty\Smarty.class.php';
define('SMARTY_VIEW_DIR', Yii::getPathOfAlias('application.views'));
class CSmarty extends Smarty {
	const DS = DIRECTORY_SEPARATOR;
	function __construct() {
		parent::__construct ();
		$config = new Sysconfig();
		$ret = $config->getConfigByType("sysconfig");
		$this->template_dir = SMARTY_VIEW_DIR . self::DS . 'tpl/'.$ret['systemplate'];
		$this->compile_dir = SMARTY_VIEW_DIR . self::DS . 'tpl_c';
		$this->caching = FALSE;
		$this->cache_dir = SMARTY_VIEW_DIR . self::DS . 'cache';
		$this->left_delimiter = '<?{';
		$this->right_delimiter = '}?>';
		$this->cache_lifetime = 0;
		$this->assign("baseurl",Yii::app()->baseUrl);
		$this->assign("template_dir",Yii::app()->baseUrl.'/protected/views/tpl/'.$ret['systemplate']);
	}
	function init() {
	}

}
?>